package com.hmdp.utils;

import java.io.*;
import java.lang.*;
import java.util.ArrayList;

public class Main3{
    
    public static int n;
    public static int k;
    public static ArrayList<Pair> pairs = new ArrayList();
           
    public static void main(String [] args) throws IOException {
       BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
       String[] strs =  bufferedReader.readLine().split(" ");
       n = Integer.valueOf(strs[0]);
       k = Integer.valueOf(strs[1]);

       int minB=0;
       for(int i=0;i<n;i++){
           strs =  bufferedReader.readLine().split(" ");
           minB=Math.max(minB,Integer.valueOf(strs[0]));
           minB=Math.max(minB,Integer.valueOf(strs[1]));
           pairs.add(new Pair(Integer.valueOf(strs[0]),Integer.valueOf(strs[1])));
       }

        long l=0,r=minB+1;
       while(l+1!=r){
           long mid = l+r>>1;
           if(check(mid)) l=mid;
           else r=mid;
       }
       System.out.println(l);
    }
    public static boolean check(long n){
        long sum = 0;
        for (Pair pair : pairs) {
            sum+= (pair.a/n)*(pair.b/n);
        }
        return sum>=k;
    }
}

class Pair{
    long a,b;
    public Pair(long a , long b){
        this.a=a;
        this.b=b;
    }
    public long getA( ){
        return this.a;
    }
    public long getB(){
        return this.b;
    }
}